package com.qyc.controller;

import com.qyc.service.UploadService;
import com.qyc.utils.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @className: UploadController
 * @Description: 文件上传模块
 * @author: qinyc
 * @date: 2023/6/23 19:18
 * @version: v1.0
 */
@Api(tags = "文件上传模块")
@RestController
@RequestMapping("/file")
public class UploadController {
    //注入UploadService层对象
    @Autowired
    private UploadService uploadService;

    /**
     * @Author qinyc
     * @Description  文件上传接口
     * @version: v1.0
     * @Date 19:24 2023/6/23
     **/
    @ApiOperation("文件上传")
    @PostMapping("/upload")
    public ResponseResult upload(@RequestPart MultipartFile file){
        return uploadService.upload(file);
    }
}
